﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Core;
/// <summary>
/// 车辆卖信息表
/// </summary>
[SugarTable(null, "车辆卖信息表")]
[SugarIndex("index_{table}_S", nameof(SellerId), OrderByType.Asc)]
[SugarIndex("index_{table}_B", nameof(BrandId), OrderByType.Asc)]
[SugarIndex("index_{table}_T", nameof(Title), OrderByType.Asc)]
public partial class AppVehicleInfo : EntityTenant
{
    /// <summary>
    /// 卖家Id
    /// </summary>
    [SugarColumn(ColumnDescription = "卖家Id")]
    public long SellerId { get; set; }

    /// <summary>
    /// 类型
    /// </summary>
    [SugarColumn(ColumnDescription = "类型", Length = 50)]
    [MaxLength(50)]
    public VehicleTypeEnum Type { get; set; }

    /// <summary>
    /// 上牌地区Id(市级)
    /// </summary>
    [SugarColumn(ColumnDescription = "上牌地区Id")]
    public long RegionId { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    [SugarColumn(ColumnDescription = "标题", Length = 100)]
    [Required, MaxLength(100)]
    public string Title { get; set; }

    /// <summary>
    /// 品牌Id
    /// </summary>
    [SugarColumn(ColumnDescription = "品牌Id")]
    public long BrandId { get; set; }

    /// <summary>
    /// 车系Id
    /// </summary>
    [SugarColumn(ColumnDescription = "车系Id")]
    public long SeriesId { get; set; }

    /// <summary>
    /// 车型Id
    /// </summary>
    [SugarColumn(ColumnDescription = "车型Id")]
    public long ModelId { get; set; }

    /// <summary>
    /// 价格(元)
    /// </summary>
    [SugarColumn(ColumnDescription = "价格", ColumnDataType = "decimal(18,2)")]
    public decimal Price { get; set; }

    /// <summary>
    /// 新车指导价(元)
    /// </summary>
    [SugarColumn(ColumnDescription = "新车指导价", ColumnDataType = "decimal(18,2)")]
    public decimal? OriginalPrice { get; set; }

    /// <summary>
    /// 里程数(公里)
    /// </summary>
    [SugarColumn(ColumnDescription = "里程数")]
    public int Mileage { get; set; }

    /// <summary>
    /// 车辆类型(数据字典)
    /// </summary>
    [SugarColumn(ColumnDescription = "车辆类型", Length = 20)]
    [MaxLength(20)]
    public string VehicleType { get; set; }

    /// <summary>
    /// 变速箱类型(数据字典)
    /// </summary>
    [SugarColumn(ColumnDescription = "变速箱类型", Length = 20)]
    [MaxLength(20)]
    public string Transmission { get; set; }

    /// <summary>
    /// 燃油类型(数据字典)
    /// </summary>
    [SugarColumn(ColumnDescription = "燃油类型", Length = 20)]
    [MaxLength(20)]
    public string FuelType { get; set; }

    /// <summary>
    /// 排放标准(数据字典)
    /// </summary>
    [SugarColumn(ColumnDescription = "排放标准", Length = 20)]
    [MaxLength(20)]
    public string? EmissionStandard { get; set; }

    /// <summary>
    /// 车况等级(1-5)
    /// </summary>
    [SugarColumn(ColumnDescription = "车况等级")]
    public int ConditionLevel { get; set; } = 3;

    /// <summary>
    /// 状态(1-待售 2-已售 3-下架)
    /// </summary>
    [SugarColumn(ColumnDescription = "状态")]
    public int Status { get; set; } = 1;

    /// <summary>
    /// 关联卖家
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(SellerId))]
    public SysUser Seller { get; set; }

    /// <summary>
    /// 关联品牌
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(BrandId))]
    public AppVehicleBrand Brand { get; set; }

    /// <summary>
    /// 车辆图片
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(AppVehicleImage.VehicleId))]
    public List<AppVehicleImage> Images { get; set; }
}
